package van.planifolia.redislock.config;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Description: TODO
 * @Author: Van.Planifolia
 * @CreateTime: 2022-12-08  18:35
 * @Version: 1.0
 */
@Configuration
public class RedisConfig {
    @Bean
    public RedissonClient redisson(){
        // 1. Create config object
        Config config = new Config();
        config.useSingleServer()
                .setAddress("redis://192.168.136.126:6379");
        return Redisson.create(config);
    }
}
